import { IsString, IsArray, IsNumber, IsOptional } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class CreateFamilyDto {
  @ApiProperty({ description: '家庭名称' })
  @IsString()
  name: string;

  @ApiProperty({ description: '成员数量' })
  @IsNumber()
  memberCount: number;

  @ApiProperty({ description: '是否有儿童' })
  @IsOptional()
  hasChildren?: boolean;

  @ApiProperty({ description: '是否有老人' })
  @IsOptional()
  hasElderly?: boolean;
}

export class FamilyPreferenceDto {
  @ApiProperty({ description: '可接受的最高辣度', minimum: 0, maximum: 5 })
  @IsOptional()
  @IsNumber()
  spicyLevel?: number;

  @ApiProperty({ description: '过敏食材' })
  @IsOptional()
  @IsArray()
  allergies?: string[];

  @ApiProperty({ description: '饮食限制（如素食）' })
  @IsOptional()
  @IsArray()
  dietaryRestrictions?: string[];
}